{% extends 'old-bootstrap-modal-layout.html.twig' %}

{% set modal_class = 'modal-lg' %}

{% block title %}
  <span class="text-muted">{{ 'admin.cloud_file.preview.content_title'|trans }}</span>
{% endblock %}

{% block body %}
  {% if file.type in ['video', 'audio', 'ppt', 'document', 'image', 'flash'] %}
    {% if file.type in ['video', 'ppt', 'document'] and file.processStatus != "ok" %}
      <div class="text-center">
        {{'admin.cloud_file.preview.failed_tips'|trans}}
      </div>
    {% else %}
      <div id="material-preview-player"
          style="height:500px;overflow:hidden;"
          data-url="{{path('material_lib_file_player', {fileId: file.id})}}"
      ></div>
    {% endif %}
  {% else %}
    <div class="text-center">
      {{'admin.cloud_file.preview.failed_tips'|trans}}
    </div>
  {% endif %}
  
  <script>app.load('cloudfile/preview')</script>
{% endblock %}

{% block footer %}
  <div class="text-muted pull-left" style="font-size:10px">
    {{ 'admin.cloud_file.preview.file_id'|trans }}：{{file.no}}
  </div>
	<button type="button" class="btn btn-primary" data-dismiss="modal">
    {{ 'admin.cloud_file.close_btn'|trans }}
  </button>
{% endblock %}
